extends PlayerStatusBase

#var position : float = 0

func start() ->void:
	actor.play_animation("jump")
	SoundManager.play_sfx("jump")
	#position = actor.position.y

# Called when the node enters the scene tree for the first time.
func run_physics_process(delta:float) -> void:
	var collision_info = actor.move_and_collision_info()
	
	#var position2 = actor.position.y
	#if position2 != position && actor.velocity.y == 0:
		#print(position2-position)
	
	if collision_info.get("is_on_floor"):
		if actor.velocity.x == 0:
			return change_status("Idle")
		else:
			return change_status("Run")

# Called every frame. 'delta' is the elapsed time since the previous frame.
func run_process(delta: float) -> void:
	common_velocity(delta)
		 
	if actor.can_attack(1):
		return change_status("Attack1")
	
	if actor.velocity.y>0:
		return change_status("Fall")
